package pe.gob.reniec.cel.dao;

import org.apache.log4j.Logger;
import org.hibernate.SessionFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.orm.hibernate3.support.HibernateDaoSupport;
import org.springframework.stereotype.Repository;
import pe.gob.reniec.cel.model.Persona;

/**
 *
 * @author Lennon Shimokawa
 */
@Repository
public class PersonaDaoHibernate extends HibernateDaoSupport implements PersonaDao {

    @Autowired
    public PersonaDaoHibernate(SessionFactory sessionFactory) {
        setSessionFactory(sessionFactory);
    }

    public Persona consultarPorDni(String dni) {
        logger.debug("Inicio consultarPorDni");
        return (Persona) getHibernateTemplate().get(Persona.class, dni);
    }
}



